﻿<phone:PhoneApplicationPage
    x:Class="WP8.Views.Asynchronous"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:Interactivity="clr-namespace:Microsoft.Practices.Prism.Interactivity;assembly=Microsoft.Practices.Prism.Interactivity.Phone"
    xmlns:vm="clr-namespace:Sample.ViewModels;assembly=Sample.ViewModels"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <phone:PhoneApplicationPage.DataContext>
        <vm:AsynchronousViewModel />
    </phone:PhoneApplicationPage.DataContext>

    <!--LayoutRoot は、すべてのページ コンテンツが配置されるルート グリッドです-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel は、アプリケーション名とページ タイトルを格納します-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="Incremental Wikipedia Search" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - 追加コンテンツをここに入力します-->
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBox Grid.Row="0" Text="{Binding SearchTerm.Value, Mode=TwoWay}">
                <i:Interaction.Behaviors>
                    <Interactivity:UpdateTextBindingOnPropertyChanged />
                </i:Interaction.Behaviors>
            </TextBox>
            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding SearchingStatus.Value}" Grid.Column="0" />
                <TextBlock Text="{Binding ProgressStatus.Value}" Grid.Column="1" />
            </Grid>
            <ListBox Grid.Row="2" ItemsSource="{Binding SearchResults.Value}" />
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>